package com.yangtzeu.jwc.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.yangtzeu.jwc.app.MyApplication;
import com.yangtzeu.jwc.business.UpdateBusiness;
import com.zhangdi.jwc.R;

public class AboutActivity extends BaseActivity {
    private TextView check_update, share;
    private TextView tv_version;
    private RelativeLayout rl_erweima;
    // private TextView author_name;
    // private TextView author_email;
    // private TextView author_QQ;
    private MyApplication mApplication;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        mApplication = (MyApplication) getApplication();
        super.onCreate(savedInstanceState);
    }

    @Override
    public void setView() {
        setContentView(R.layout.activity_about);
    }

    @Override
    public void initActionBar() {
        setSimpleActionBar(null, "关于", null, null);
    }

    @Override
    public void initListener() {
        super.initListener();
        check_update.setOnClickListener(this);
        share.setOnClickListener(this);
        rl_erweima.setOnClickListener(this);
    }

    @Override
    public void initAdapter() {
        super.initAdapter();
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.check_update:
                UpdateBusiness ub = new UpdateBusiness(this);
                ub.update(null);
                break;
            case R.id.share_app:
                rl_erweima.setVisibility(View.VISIBLE);
                break;

            case R.id.rl_erweima:
                rl_erweima.setVisibility(View.GONE);
                break;
            default:
                break;
        }
    }

    @Override
    public void initView() {
        tv_version = (TextView) findViewById(R.id.tv_version);
        // author_name = (TextView) findViewById(R.id.author_name);
        // author_email = (TextView) findViewById(R.id.author_email);
        // author_QQ = (TextView) findViewById(R.id.author_QQ);
        tv_version.setText("v " + mApplication.getVersion(this));
        check_update = (TextView) findViewById(R.id.check_update);
        rl_erweima = (RelativeLayout) findViewById(R.id.rl_erweima);
        share = (TextView) findViewById(R.id.share_app);
    }
}
